package dungeon;

import be.kuleuven.cs.som.annotate.Basic;
import be.kuleuven.cs.som.annotate.Immutable;
import be.kuleuven.cs.som.annotate.Raw;
/**
 * This class represents a wall that can lie between two squares.
 * It can be inherently slippery.
 * A wall can't be accessible.
 * 
 * @invar	| ! this.isAccessible()
 * 
 * @author Frederik
 *
 */
public class Wall extends Obstacle {

	/**
	 * Initialize a new wall without given the fact whether it is inherently slippery.
	 * 
	 * @param inherentlySlippery	Whether the wall is inherently slippery.
	 */
	public Wall(boolean inherentlySlippery){
		super(inherentlySlippery);
	}
	
	/**
	 * Return whether this wall is accessible.
	 * @return	Whether this wall is accessible.
	 * 			| result == false
	 */
	@Basic @Raw  @Immutable
	public boolean isAccessible(){
		return this.accessible;
	}
	
	/**
	 * A variable that registers whether this wall is accessible.
	 */
	private final boolean accessible = false;

	/**
	 * Check whether it is a valid square to add to this obstacle.
	 * 
	 * @param 	square
	 * 			The square that is or isn't valid to border this obstacle.
	 * @return	| if (square != null && square != this.getFirstSquare() && !(square instanceof TransparantSquare))
	 * 			|	then result == true
	 */
	public boolean isValidSquareToAdd(Square square) {
		return (super.isValidSquareToAdd(square) && ! (square instanceof TransparentSquare));
	}
}
